package com.huilian.iotbox.admin.wap.controller;

import com.huilian.iotbox.data.common.ServerResponse;
import com.huilian.iotbox.data.po.LogManipulate;
import com.huilian.iotbox.data.service.LogManipulateService;
import com.huilian.iotbox.data.vo.UserInfo;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @author 龙 路 飞
 * @CreateDate: 2021-11-23 11:00
 * @Description:
 */
@RestController
@RequestMapping("/api/logManipulate")
public class LogManipulateController extends UserInfoController {
    @Resource
    private LogManipulateService logManipulateService;
    @PostMapping("/list")
    public ServerResponse list(@RequestBody LogManipulate logManipulate, HttpServletRequest request) {
        UserInfo userInfo = super.getLoginUserInfo(request);
        logManipulate.setUserInfo(userInfo);
        return ServerResponse.createBySuccess(logManipulateService.findAllByKeyword(logManipulate));
    }

}
